<template>
  <div id="cesiumViewer" class="fullSize"></div>
</template>

<script>
  window.CESIUM_BASE_URL = '/static/Cesium'
  import * as Cesium from 'cesium'
  import 'cesium/Build/Cesium/Widgets/widgets.css'

  export default {
    name: 'Scene',
    mounted() {
      const viewer = new Cesium.Viewer('cesiumViewer', {
        // terrainProvider: Cesium.createWorldTerrain(),
        baseLayerPicker: false,
        // 天地图影像
        imageryProvider: new Cesium.WebMapTileServiceImageryProvider({
          url: 'https://t2.tianditu.gov.cn/img_w/wmts?tk=859e010cf86575ec92544de21ad4472e',
          layer: 'img',
          style: 'default',
          format: 'tiles',
          tileMatrixSetID: 'w',
          maximumLevel: 18
        })
      })
      viewer.camera.flyTo({
        destination: Cesium.Cartesian3.fromDegrees(-122.4175, 37.655, 400),
        orientation: {
          heading: Cesium.Math.toRadians(0.0)
        }
      })
    }
  }
</script>

<style scoped>

</style>
